<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database">
	<description>
		Spring.NET config file for all spring managed objects
	</description>

	<!-- Repositories-->
	<object id="IMilestoneRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.MilestoneRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>
	
	<object id="IPersonRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.PersonRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>

	<object id="IProjectRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.ProjectRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>

	<object id="IProjectPersonRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.ProjectPersonRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>

	<object id="IWorkItemRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.WorkItemRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>

	<object id="IWorkItemCategoryRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.WorkItemCategoryRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>

	<object id="IWorkItemStatusRepository" type="Spring.Aop.Framework.ProxyFactoryObject">
		<property name="target">
			<object type="ShopSpace.Core.Repositories.Impl.WorkItemStatusRepository, ShopSpace.Core">
				<property name="GenericDAO" ref="IGenericDAO" />
			</object>
		</property>
		<property name="interceptorNames">
			<list>
				<value>transactionAdvisor</value>
			</list>
		</property>
	</object>

	<!-- Infrastructure -->
	<object id="IGenericDAO" type="ShopSpace.Infrastructure.Data.Impl.GenericDAO, ShopSpace.Infrastructure">
		<property name="SessionFactory" ref="ISessionFactory" />
	</object>

	<!-- Database and NHibernate Configuration -->
	<object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
		<property name="ConfigSections" value="databaseSettings"/>
	</object>

	<db:provider
	  id="DbProvider"
	  provider="SqlServer-2.0"
	  connectionString="Data Source=${db.DataSource};Database=${db.Database};uid=${db.Username};pwd=${db.Password};Application Name=${db.ApplicationName};" />

	<object id="ISessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate20">
		<property name="DbProvider" ref="DbProvider"/>
		<property name="MappingAssemblies">
			<list>
				<value>ShopSpace.Core</value>
			</list>
		</property>
		<property name="HibernateProperties">
			<dictionary>
				<entry key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
				<entry key="dialect" value="NHibernate.Dialect.MsSql2005Dialect"/>
				<entry key="current_session_context_class" value="Spring.Data.NHibernate.SpringSessionContext, Spring.Data.NHibernate20"/>
				<entry key="show_sql" value="false"/>
			</dictionary>
		</property>
	</object>

	<!--Transaction Manager-->
	<object id="HibernateTransactionManager" type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate20">
		<property name="DbProvider" ref="DbProvider"/>
		<property name="SessionFactory" ref="ISessionFactory"/>
		<property name="AdoExceptionTranslator" ref="FallbackExceptionTranslator" />
	</object>

	<object id="FallbackExceptionTranslator" type="Spring.Data.Support.FallbackExceptionTranslator, Spring.Data" />

	<object id="transactionInterceptor" type="Spring.Transaction.Interceptor.TransactionInterceptor, Spring.Data">
		<property name="TransactionManager" ref="HibernateTransactionManager"/>
		<property name="TransactionAttributeSource" ref="attributeTransactionAttributeSource"/>
	</object>

	<object id="transactionAdvisor" type="Spring.Transaction.Interceptor.TransactionAttributeSourceAdvisor, Spring.Data">
		<property name="TransactionInterceptor" ref="transactionInterceptor"/>
	</object>

	<object id="attributeTransactionAttributeSource" type="Spring.Transaction.Interceptor.AttributesTransactionAttributeSource, Spring.Data" />

</objects>